import unicorn from 'eslint-plugin-unicorn'
import { FlatConfig, OptionsOverrides } from '../types'

export default async ({ overrides = {} }: OptionsOverrides = {}): Promise<FlatConfig[]> => [
  {
    name: 'vill-v/unicorn',
    plugins: {
      unicorn,
    },
    rules: {
      'unicorn/empty-brace-spaces': 'error',
      'unicorn/no-instanceof-builtins': 'error',
      'unicorn/no-new-buffer': 'error',
      'unicorn/no-typeof-undefined': 'error',
      'unicorn/no-useless-undefined': 'error',
      'unicorn/prefer-date-now': 'error',
      'unicorn/prefer-dom-node-text-content': 'error',
      'unicorn/prefer-keyboard-event-key': 'warn',
      'unicorn/prefer-logical-operator-over-ternary': 'warn',
      'unicorn/prefer-node-protocol': 'warn',
      ...overrides,
    },
  },
]
